package com.th.supcom.pds.dispensedrug.server;

import net.carefx.framework.container.client.exception.UiException;
import net.carefx.framework.web.gwt.server.GwtController;

import com.th.supcom.pds.dispensedrug.client.service.PdsSupplyRpc;
import com.th.supcom.pds.internal.api.PdsSupplyService;

/**
 * PdsSupply 控制层.
 * 
 * 处方主记录.
 */
public class PdsSupplyServiceController extends GwtController implements PdsSupplyRpc
{
    private static final long serialVersionUID = 1L;
    private PdsSupplyService m_pdsSupplyService;

    /**
     * 默认构造函数.
     */
    public PdsSupplyServiceController ()
    {

    }

   /* *//**
     * 通过患者ID，时间段 查询所有的处方号
     * 
     * @param patientId
     * @param enterDate
     * @return
     * @throws UiException
     *//*
    @Override
    public List <String> findSupplyNoListByPatientId (String patientId, Date enterDate) throws UiException
    {
        try
        {
            List <String> SupplyNoList = null;
                    //m_pdsSupplyService.findSupplyNoListByPatientId (patientId, enterDate);
            return SupplyNoList;
        }
        catch (Exception e)
        {
            throw new BusinessException (e.getMessage (), e);
        }
    }

    @Override
    public void addPdsSupply (final PdsSupplyDetailInfoModel pdsSupplyDetailInfoModel) throws UiException
    {
        final PdsSupply pdsSupply = ConvertUtils.convert (PdsSupply.class, pdsSupplyDetailInfoModel);
        //m_pdsSupplyService.addPdsSupply (pdsSupply);
    }

    @Override
    public List <PdsSupplyCombineModel> getCombinePdsSupplyListByExample (final PdsSupplyCombineModel pdsSupplyCombineModel, String IP) throws UiException
    {
        final PdsSupplyCombine pdsSupplyCombine = ConvertUtils.convert (PdsSupplyCombine.class, pdsSupplyCombineModel);
        final List <PdsSupplyCombine> pdsSupplysList =null;
                //m_pdsSupplyService.findCombinePdsSupplyListByExample (pdsSupplyCombine, IP);
        return ConvertUtils.convert (PdsSupplyCombineModel.class, pdsSupplysList);
    }

    @Override
    public ResultModel getCombinePdsSupplyListByRcptNo (final String rcptNo, final String SupplyNo) throws UiException
    {
        ResultModel resultModel = new ResultModel ();
        final Map <String, Object> params = new HashMap <String, Object> ();
        params.put ("rcptNo", rcptNo);
        params.put ("SupplyNo", SupplyNo);
        Result result =null;
                //m_pdsSupplyService.findCombinePdsSupplyListByMap (params);
        //List <PdsSupplyCombineModel> SupplyModelList =null;
                //ConvertUtils.convert (PdsSupplyCombineModel.class, result.getPdsSupplyCombines ());
        //resultModel.setPdsSupplyCombineModelList (SupplyModelList);
        PatientInfoModel patientInfoModel = ConvertUtils.convert (PatientInfoModel.class, result.getPatientInfo ());
        resultModel.setPatientInfoModel (patientInfoModel);
        return resultModel;
    }

    @Override
    public List <PdsSupplyDetailInfoModel> getPdsSupplyListByExample (final PdsSupplyDetailInfoModel pdsSupplyDetailInfoModel) throws UiException
    {
        final PdsSupply pdsSupply = ConvertUtils.convert (PdsSupply.class, pdsSupplyDetailInfoModel);
        final List <PdsSupply> pdsSupplysList =null;
               // m_pdsSupplyService.findPdsSupplyListByExample (pdsSupply);
        return ConvertUtils.convert (PdsSupplyDetailInfoModel.class, pdsSupplysList);
    }

    @Override
    public PagingLoadResult <PdsSupplyDetailInfoModel> getPdsSupplyListWithPaging (final PagingLoadConfig config)
    {

        return new BasePagingLoadResult <PdsSupplyDetailInfoModel> (new ArrayList <PdsSupplyDetailInfoModel> (), config.getOffset (), 10);
    }

    @Override
    public void modifyPdsSupply (final PdsSupplyDetailInfoModel pdsSupplyDetailInfoModel) throws UiException
    {
        final PdsSupply pdsSupply = ConvertUtils.convert (PdsSupply.class, pdsSupplyDetailInfoModel);
        //m_pdsSupplyService.modifyPdsSupplyByExample (pdsSupply);
    }
*/
    public void setPdsSupplyService (PdsSupplyService pdsSupplyService)
    {
    
        m_pdsSupplyService = pdsSupplyService;
    }


}